import axios from "axios";

const instance = axios.create({
    baseURL: "", // 更改为您自己的 Python 后端 API 地址
    withCredentials: true  //跨域时携带认证信息
});

export const fetchCompletions = async (prompt) => {
    try {
        const response = await instance.post("", {
            prompt: prompt
        });
        console.log(response.data);
        return response;
    } catch (error) {
        console.error(error);
        return null;
    }
};